home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / edit / bsort201.zip / BIGSORT.DOC < prev    next >
Text File  |  1994-11-19  |  24KB  |  459 lines

  1.  
  2.                                  BIGSORT(tm)
  3.                                 Version 2.01
  4.  
  5.                        Written By: David Sheppard Poor
  6.  
  7.               Copyright (C) 1994: MeadowBrook Industries, Ltd
  8.                              ALL RIGHTS RESERVED
  9.  
  10.  
  11. DESCRIPTION: A utility to sort files:
  12.           * Sorts small to extremely large files
  13.           * Customized and complex key structures
  14.           * FAST!
  15.           * Fixed length and variable length records
  16.           * Supports comma and other delimited file formats
  17.           * Supports dBASE and compatible file formats
  18.           * Up to eight input files with a single output file
  19.           * Both command-line and interactive versions included
  20.           * Context-sensitive help
  21.           * Easy batch-file integration
  22.  
  23. GETTING STARTED:
  24.      Type BIGSORT and try press F1.  The on-line context sensitive help
  25.      system is often the best guide to learning BigSort.  This document
  26.      describes how to specify parameters on the command line, as well as
  27.      ASP and shareware information, and how to reach MeadowBrook Industries.
  28.  
  29. DOS BASED HELP:  Enter: BigSort /?
  30.  
  31. EXECUTION:
  32.      Interactive version:
  33.           BigSort
  34.  
  35.      Command line version:
  36.           BigSort InputFile OutputFile [Format [Key[+Key2[+Key3..]]]]
  37.            -or-
  38.           BigSortC InputFile OutputFile [Format [Key[+Key2[+Key3..]]]]
  39.            -or-
  40.           BigSort SettingsFile
  41.                   
  42.                Note: The settings file is created through an interactive
  43.                      session.  The settings file can also be renamed to
  44.                      have a .BAT extension and used as a batch file.
  45.  
  46. BASIC PARAMETERS (command line version):
  47.    INPUT FILE: Should contain all the data you want to sort.  If an input
  48.           file is not in the current directory, explicitly give the path
  49.           (e.g. C:\DATA\DATAFILE.TXT).  Up to eight files can be combined as
  50.           multiple input files, with the output going to a single output
  51.           file.  Wildcards (? and *) may be used, and multiple file
  52.           specifications can be combined with a plus (+) immediately between
  53.           each input file spec (e.g. C:\USER\YOU\*.DAT+C:\DATA\*.DAT).  Note
  54.           that if the format of the input file is dBASE, there can only be
  55.           one input file.
  56.  
  57.    OUTPUT FILE: All data from the input file(s) will be written to this file.
  58.  
  59.    FORMAT: Describes the format of the input and output data files.
  60.           CRLF:               Standard variable length records. (Default)
  61.           Custom Variable:    Any variable length records. (See "FORMAT")
  62.           FIXED:              Standard fixed length records.
  63.           Custom Fixed:       Any fixed length records. (See "FORMAT")
  64.           COMMA:              Standard comma delimited records.
  65.           Custom Delimited:   Any delimited records. (See "FORMAT")
  66.           dBASE:              For dBASE III and IV records.
  67.  
  68.    KEY:   The key defines what part of each record will be used to sort the
  69.           records.  The key is made up of segments of the form:
  70.                RecordPosition[(FieldLength)][/A|/D][/S|/I][/L|/R]
  71.           Each segment consists of the following elements:
  72.                RecordPosition      Starting position in the record.
  73.                FieldLength         Number of byte for the key segment.
  74.                Switches            Sets case sensitivity and ordering.
  75.  
  76. FORMAT: The Format tells BigSort(tm) what kind of input to expect.  There are
  77.      four basic flavors:
  78.           Fixed: All records are exactly the same number of bytes.  This is
  79.                generally the most speed-efficient record format.
  80.           Variable: Records may differ in length, but each ends with a
  81.                characteristic "end-of-record" marker.  This is the default.
  82.           Delimited: Variable length records, where each part of the record
  83.                is split into fields.  The delimiter separates these fields.
  84.           dBASE: Records compatible with dBASE III or dBASE IV.
  85.  
  86.      FIXED: Specifies the number bytes in each record is the same, and each
  87.           record has an end-of-record marker of CR (carriage return) followed
  88.           by LF (line feed).  BigSort(tm) will automatically figure out the
  89.           length of the Fixed records in the input file. To use, enter the
  90.           format parameter as be "FIXED".  Since sorting fixed length records
  91.           is faster than variable length records, specify FIXED records
  92.           instead of CR/LF whenever applicable.
  93.  
  94.      Custom Fixed: Specifies the number of bytes per record, which includes
  95.           the end-of-record marker (e.g. if the record ends in CR/LF, be sure
  96.           to include the two bytes in the record length).  To use, set the
  97.           format to be a decimal number, such as "200".
  98.  
  99.      CR/LF: Specifies the precise CR and LF byte(s) which mark the end of
  100.           each record. To use, set the format parameter to be CR, LF, CRLF,
  101.           LFCR, etc.  The CR/LF end of record marker can be used for fixed
  102.           length records and/or variable length records.  Note that many word
  103.           processors, editors, etc. use CRLF to denote the end of a line.
  104.  
  105.      Custom Variable: Specifies the precise byte(s) used to mark the end of
  106.           each record, in HEX form.  This format begins with a pound sign (#)
  107.           and is followed by the hex representation of the bytes denoting the
  108.           end of each record.  This form can be used for the same purpose as
  109.           CR/LF (where CRLF would be represented as #0D0A) as well as for
  110.           more specialized markers (e.g. #00 for null-terminated records).
  111.  
  112.      COMMA: Specifies the records are comma delimited.  This means each field
  113.           of the record is separated by a comma, text fields are enclosed by
  114.           double quotes, and each record is terminated by CRLF.  To use,
  115.           enter the format parameter as "COMMA".  Note that this is the type
  116.           of data file commonly created by programs written in BASIC.
  117.  
  118.      Custom Delimited: For delimited records, other than standard COMMA
  119.           delimited.  This format is comprised of a dollar sign ($), the hex
  120.           representations of the delimiter and text marker, a colon (:), and
  121.           a end-of-record marker.  For example, the standard COMMA delimited
  122.           format can be represented as "$2C22:0D0A", where the delimiter is a
  123.           comma, the text marker is a double quote, and the end-of-record
  124.           marker is CRLF.  This format is seldom used.
  125.      dBASE: For records compatible with the dBASE III or IV file formats. 
  126.           Note that only one dBASE file can be sorted at a time.  To use,
  127.           enter the format as "dBASE".
  128.  
  129. KEYS: The key specifies how the file should be sorted.  The default key is
  130.      "1(100)/L/A/S", i.e. the key starts in position 1, is 100 bytes long, is
  131.      read from left to right, is in ascending order, and is case sensitive.
  132.  
  133.      If a key is specified, each segment of the key is specified by fields in
  134.      the form:  KeyPos[(KeyLen)][/L|/R][/A|/D][/S|/I]. Each segment can be up
  135.      to 255 bytes, and the total length of all segments may not exceed 1024
  136.      bytes.  When a segment is specified, the first field (the KeyPos) is
  137.      required, and the others may be omitted if the defaults are appropriate.
  138.  
  139.   KEYPOS: For Fixed and Variable records:
  140.                The segment's starting position in the record.  (ie.if the
  141.                KeyPos is 10, the segment starts at the 10th byte.)
  142.           For Delimited and dBASE records:
  143.                The field number, where the first field is number 1.  (ie. if
  144.                the KeyPos is 10, the segment would be the 10th field.)
  145.  
  146.   KEYLEN: For Fixed and Variable records:
  147.                Number of bytes for the key segment.  If the records are of
  148.                variable length and the key goes beyond the end of the record,
  149.                #00 is automatically used to fill in the blank space.  
  150.           For Delimited records:
  151.                In the case of numeric fields, always set the KeyLen to 0. 
  152.                For non-numeric fields, KeyLen refers to the number of bytes
  153.                to use from the field, not including the text markers.
  154.           For dBASE records:
  155.                Do not specify a KeyLen.  the length of the segment will be
  156.                set automatically, as defined by the input dBASE file.
  157.      NOTE: If a KeyPos is given without a KeyLen, the KeyLen defaults to 1.
  158.  
  159.   SEQUENCE: The /L and /R switches denote Left-to-Right and Right-to-Left
  160.      ordering.  The default is /L.  Use /R when, for example, you are sorting
  161.      a binary word, and you need to reverse the order of the hi and lo bytes. 
  162.      (e.g. 20(2)/R).  Note that the KeyPos is still the left-most byte when
  163.      using the /R switch. (e.g. the key will use byte 21 followed by 20).
  164.  
  165.   ORDER: The /A and /D switches denote ascending or descending order.  The
  166.      default is /A.  Use /D when, for example, you want the largest number to
  167.      come first in the list. (eg. 10(3)/D).  Note that in the example the
  168.      first three digits starting in position 10 are used.
  169.  
  170.   CASE SENSITIVITY: The /S and /I switches denote Case Sensitive and Case
  171.      Insensitive (or Ignore Case) ordering.  The default is /S. Using a key
  172.      of 1(15)/I will put Michigan before MISSISSIPPI. The key 1(15)/S will
  173.      put MISSISSIPPI before Michigan.  Be sure to always use the /S switch
  174.      when sorting binary numbers.  Also, using the /I may degrade the
  175.      efficiency of bigsort(tm) up to 25%.  See "Suggestions and Technical
  176.      Notes" below for more on how to improve efficiency.
  177.  
  178.   SEGMENTS: The key may be broken into segments when the sorting criteria is
  179.      spread throughout the record.  To do this, put a plus (+) between each
  180.      segment.  Note the second segment will only be used if the first
  181.      segments match exactly.  (e.g. A key such as 100(10)+200(5) will sort
  182.      starting at position 100 for 10 bytes.  If two records have the exact
  183.      same 10 bytes, the 5 bytes at position 200 will serve as a tie breaker.
  184. EXAMPLES: THE BASICS:
  185.  
  186.      There are four sample files included.  They are:
  187.           Sample.TXT     Standard ASCII version of the sample data
  188.           Sample.TX2     Second ASCII version file
  189.           Sample.DEL     Comma delimited version of the sample data
  190.           Sample.DBF     dBASE version of the sample data.
  191.  
  192.      The sample data includes records of states names, capitals, their postal
  193.      abbreviations, and state populations.
  194.  
  195.      To look at the input file, type:
  196.           TYPE SAMPLE.TXT | MORE
  197.      Note that the "|" character is not a colon; it is a vertical bar.  If
  198.      you are working on a portable computer keyboard, you may not have access
  199.      to this character.
  200.  
  201.      After trying an example, look at the output by typing:
  202.           TYPE OUT.DAT | MORE
  203.      To look at the output of the dBASE samples, you must use a database
  204.      package.
  205.  
  206.  1)  To sort by state name, use:
  207.           BigSort SAMPLE.TXT OUT.DAT         (Defaults)
  208.      -or- BigSort SAMPLE.TXT OUT.DAT CRLF 1(14)   Format = CRLF
  209.      -or- BigSort SAMPLE.TXT OUT.DAT FIXED 1(14)  Format = Fixed
  210.      -or- BigSort SAMPLE.TXT OUT.DAT 43 1(14)     Format = Fixed 43
  211.      The output from any of these will be the same.  Note that the fixed
  212.           formats are much faster.  Since the default is CRLF with a key of
  213.           100, it is often good to specify FIXED when you can.
  214.  
  215.  2)  To sort by population, use:
  216.           BigSort SAMPLE.TXT OUT.DAT FIXED 34(8)
  217.      Note that numbers can be sorted when they are right justified.
  218.  
  219.  3)  When the populations are the same, use state names to break the tie:
  220.           BigSort SAMPLE.TXT OUT.DAT FIXED 34(8)+1(14)
  221.      Note: when two keys match exactly for the whole key, the one which
  222.           appeared first in the input file will appear first in the output
  223.           file.
  224.  
  225.  4)  If you have two files with the same format, they can be sorted together. 
  226.      Since there is only one text example file included, we will use it twice
  227.      for demonstration purposes:
  228.           BigSort SAMPLE.TXT+SAMPLE.TXT OUT.DAT FIXED 1(14)
  229.      The output will have two records for each state.
  230.  
  231. EXAMPLES: COMMA AND dBASE:
  232.  
  233.      Both dBASE and delimited forms are based on fields, as opposed to fixed
  234.      positions.
  235.  
  236.  1)  To sort by state name, use:
  237.           BigSort SAMPLE.DEL OUT.DAT COMMA 1(14)(Delimited Only)
  238.      -or- BigSort SAMPLE.DBF OUT.DBF dBASE 1 (dBASE Only)
  239.  
  240.  2)  To sort by state population, use:
  241.           BigSort SAMPLE.DEL OUT.DAT COMMA 4(0) (Delimited Only)
  242.      -or- BigSort SAMPLE.DBF OUT.DBF dBASE 4 (For dBASE Only)
  243.      Note: By not specifying a length in the delimited field, BigSort(tm)
  244.           knows to treat the field as a number.
  245.  
  246.  3)  If there were a second file (SAMPLE2.DEL), use:
  247.           BigSort SAMPLE*.DEL OUT.DAT COMMA 1(14)
  248.      -or- BigSort SAMPLE.DEL+SAMPLE2.DEL OUT.DAT COMMA 1(14)
  249.      Note: dBASE files can not be sorted together.  You can, however, sort
  250.           two dBASE files separately.
  251.  
  252.  
  253. EXAMPLES: SWITCHES:
  254.  
  255.  1)  If the states are sometimes all in capitals and sometimes starting with
  256.      a single capital followed by lower case letters, use:
  257.              BigSort SAMPLE.TXT OUT.DAT FIXED 1(14)/I
  258.      Note: The /I switch turns off case sensitivity (case Insensitive) and
  259.           allows upper and lower case words to be sorted together.  Without
  260.           the /I switch, they would not be sorted properly.  Note, however,
  261.           that the /I switch slows down processing by about 25%.  Also, never
  262.           use the /I switch with binary numbers.
  263.  
  264.  2)  To sort by state name from "Z" to "A", use:
  265.              BigSort SAMPLE.TXT OUT.DAT FIXED 1(14)/D/I
  266.      Note: The /D switch stands for Descending ordering.
  267.  
  268.  3)  To sort by state name within descending population (99999 -> 00000),
  269.      use:
  270.              BigSort SAMPLE.TXT OUT.DAT FIXED 34(8)/D+1(14)/I
  271.  
  272.  4)  There are some cases in which you might want to reverse the order of the
  273.      characters.  This is especially true when sorting binary numbers.  As an
  274.      example, you might want to sort the state postal code, so that the first
  275.      letter counts as the second digit and vice-versa:
  276.              BigSort SAMPLE.TXT OUT.DAT FIXED 17(1)+16(1)
  277.      -or-    BigSort SAMPLE.TXT OUT.DAT FIXED 16(2)/R
  278.  
  279. SUGGESTIONS AND TECHNICAL NOTES:
  280.  
  281.   A) If the records are known to be of fixed length and that length is known,
  282.      use the FIXED or Record Length format.  BigSort(tm) is fastest with
  283.      fixed length records, performing about 25% better than the default CR/LF
  284.      variable record length format.
  285.  
  286.   B) Avoid using the /I switch when it is not necessary.  It can slow down
  287.      processing by 25%.
  288.  
  289.   C) To maximize its efficiency, have as much RAM available as possible when
  290.      running; the less swapped to disk, the better.
  291.  
  292.   D) To further improve efficiency, send the output to a different volume
  293.      (another hard disk) if available. This prevents the drive from going
  294.      back and forth from the input and output files, which can add up to lots
  295.      of time.  DO NOT use a floppy disk, as they are VERY slow.
  296.  
  297.   E) Make sure there are sufficient FILES available, as defined in your
  298.      CONFIG.SYS.  Generally only about 4 FILES are necessary.  However, in
  299.      the worst case BigSort(tm) requires many more FILES.  Make sure your
  300.      CONFIG.SYS sets FILES=15 or more.
  301.  
  302.   F) The maximum length all the input files is 2,147,483,647 bytes (2GB). 
  303.      The maximum length of each record is 65535 bytes (64KB).  There can be
  304.      up to eight key segments, for a total maximum length of 1024 bytes. 
  305.      Each segment can be up to 255 bytes long.
  306.  
  307.   G) Don't use the name of the input file for the output file.  If you have a
  308.      type-o or the power goes out, you could lose both the original and
  309.      sorted data!
  310.  
  311.   H) Keep the key as short as possible.  For instance, if one part of the key
  312.      is a number which is unique to each record, don't include any additional
  313.      key segments.  Also avoid large sections of white space in the key.
  314.  
  315.   I) Here is a neat trick: If you have a long text file, and you want to sort
  316.      groups of records, place an extra blank line (CR/LF) after each group. 
  317.      Then enter: BigSort <InputFile> <OutputFile> CRLFCRLF <SomeKey>.  This
  318.      tells BigSort(tm) that the group of records is a single variable-length
  319.      record.  This works provided no group of records exceeds 64k.
  320.  
  321. DEFINITION OF SHAREWARE:
  322.  
  323.      Shareware distribution gives users a chance to try software before
  324.      buying it. If you try a Shareware program and continue using it, you are
  325.      expected to register. Individual programs differ on details -- some
  326.      request registration while others require it, some specify a maximum
  327.      trial period. With registration, you get anything from the simple right
  328.      to continue using the software to an updated program with printed
  329.      manual.
  330.  
  331.      Copyright laws apply to both Shareware and commercial software, and the
  332.      copyright holder retains all rights, with a few specific exceptions as
  333.      stated below. Shareware authors are accomplished programmers, just like
  334.      commercial authors, and the programs are of comparable quality. (In both
  335.      cases, there are good programs and bad ones!) The main difference is in
  336.      the method of distribution. The author specifically grants the right to
  337.      copy and distribute the software, either to all and sundry or to a
  338.      specific group. For example, some authors require written permission
  339.      before a commercial disk vendor may copy their Shareware.
  340.  
  341.      Shareware is a distribution method, not a type of software. You should
  342.      find software that suits your needs and pocketbook, whether it's
  343.      commercial or Shareware. The Shareware system makes fitting your needs
  344.      easier, because you can try before you buy. And because the overhead is
  345.      low, prices are low also. Shareware has the ultimate money-back
  346.      guarantee -- if you don't use the product, you don't pay for it.
  347.  
  348. THE ASSOCIATION OF SHAREWARE PROFESSIONALS:
  349.  
  350.      BigSort(tm) is produced by a member of the Association of Shareware
  351.      Professionals (ASP). ASP wants to make sure that the shareware principle
  352.      works for you.  If you are unable to resolve a shareware-related problem
  353.      with an ASP member by contacting the member directly, ASP may be able to
  354.      help.  The ASP Ombudsman can help you resolve a dispute or problem with
  355.      an ASP member, but does not provide technical support for members'
  356.      products.  Please write to the ASP ombudsman at 545 Grover Road,
  357.      Muskegon, MI 49442-9427 USA, FAX 616-788-2765 or send a CompuServe
  358.      message via CompuServe Mail to ASP Ombudsman 70007,3536.
  359.  
  360.                    _______
  361.               ____|__     |               (R)
  362.            --|       |    |-------------------
  363.              |   ____|__  |  Association of
  364.              |  |       |_|  Shareware
  365.              |__|   o   |    Professionals
  366.            -----|   |   |---------------------
  367.                 |___|___|    MEMBER
  368.  
  369.  
  370. DISCLAIMER - AGREEMENT:
  371.  
  372.      Users of BigSort(tm) must accept this disclaimer of warranty:
  373.      "BigSort(tm) is supplied as is.  The author disclaims all warranties,
  374.      expressed or implied, including, without limitation, the warranties of
  375.      merchantability and of fitness for any purpose. The author assumes no
  376.      liability for damages, direct or consequential, which may result from
  377.      the use of BigSort(tm)."
  378.  
  379.      BigSort(tm) is a "shareware program" and is provided at no charge to the
  380.      user for evaluation.  Feel free to share it with your friends, but
  381.      please do not give it away altered or as part of another system.  The
  382.      essence of "user-supported" software is to provide personal computer
  383.      users with quality software without high prices, and yet to provide
  384.      incentive for programmers to continue to develop new products.  If you
  385.      find this program useful and find that you are using BigSort(tm) and
  386.      continue to use BigSort(tm) after a reasonable trial period, you must
  387.      make a registration payment of $20 to MeadowBrook Industries, Ltd.  The
  388.      $20 registration fee will license one copy for use on any one computer
  389.      at any one time.  You must treat this software just like a book.  An
  390.      example is that this software may be used by any number of people and
  391.      may be freely moved from one computer location to another, so long as
  392.      there is no possibility of it being used at one location while it's
  393.      being used at another. Just as a book cannot be read by two different
  394.      persons at the same time.
  395.  
  396.      Commercial users of BigSort(tm) must register and pay for their copies
  397.      of BigSort(tm) within 30 days of first use or their license is
  398.      withdrawn.  Site-License arrangements may be made by contacting
  399.      MeadowBrook Industries, Ltd.
  400.  
  401.      Anyone distributing BigSort(tm) for any kind of remuneration must first
  402.      contact MeadowBrook Industries, Ltd at the address below for
  403.      authorization. This authorization will be automatically granted to
  404.      distributors recognized by the (ASP) as adhering to its guidelines for
  405.      shareware distributors, and such distributors may begin offering
  406.      BigSort(tm) immediately (However MeadowBrook Industries, Ltd must still
  407.      be advised so that the distributor can be kept up-to-date with the
  408.      latest version of BigSort(tm)).
  409.  
  410.      You are encouraged to pass a copy of BigSort(tm) along to your friends
  411.      for evaluation.  Please encourage them to register their copy if they
  412.      find that they can use it.  All registered users will receive a copy of
  413.      the latest version of the BigSort(tm) system and printed documentation.
  414.  
  415. SUPPORT:
  416.  
  417.      If you have any questions or problems concerning the use of BigSort(tm),
  418.      please write to the address below.  Alternately, if you are a user of
  419.      email, write to the email address listed below for a faster response. 
  420.      There are no duration restrictions placed on BigSort's support services. 
  421.      When requesting support, be sure to include the version number, as well
  422.      as a complete description of the problem.
  423.  
  424. REGISTRATION: 
  425.  
  426.      Once you have determined BigSort(tm) is a tool you intend to use, please
  427.      register your copy:
  428.  
  429.      SINGLE MACHINE LICENSE:                      $ 20.00
  430.  
  431.      MULTIPLE SINGLE USER MACHINE LICENSES:       $ 15.00 per machine
  432.                                                        (2+ computers)
  433.  
  434.      NETWORKED MACHINE LICENSES / SINGLE SERVER:  $ 10.00 per node
  435.                                                        (4+ computers)
  436.  
  437.      Please include 6% sales tax in New Jersey and Pennsylvania.
  438.  
  439.      After receiving your registration fee, MeadowBrook will send your
  440.      registered copies of the latest version of BigSort(tm) with printed
  441.      documentation, and upgrade information as it becomes available.  Be sure
  442.      to include your address and to specify either 3 1/2 or 5 1/4 inch disks.
  443.      If you prefer product information to arrive via email rather than
  444.      conventional mail, please include your email address.  Please see
  445.      REGISTER.DOC for more information.
  446.  
  447.  
  448. CONTACTING MEADOWBROOK INDUSTRIES:
  449.  
  450.      If you have any questions, suggestions, or wish to register BigSort(tm),
  451.           write to:
  452.                     BigSort(tm)
  453.                     MeadowBrook Industries, Ltd.
  454.                     1805 Underwood Blvd.
  455.                     Delran, NJ 08075
  456.  
  457.      Or send e-mail to: bigsort@uniscore.com
  458.  
  459.